{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e0cd1985-f7ac-4dd0-afa5-a6246c2d75b9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c7cb3f80-eb27-40f1-bb96-66bd01b91e13",
   "metadata": {},
   "outputs": [],
   "source": [
    "from perspective.widget import Perspectivewidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "450c462f-8ea9-48bb-8cf6-745c540147c9",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")\n",
    "d1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1f8b50ca-5513-4840-a0eb-2899f15b07d5",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4ec1a284-940c-47c6-b4d8-c6b436c89a39",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")\n",
    "d2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3abdd0f8-f2fd-4268-991b-acecb06ad1d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "25497e55-83bd-4a02-915e-372a545f8bf2",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "418d8c8f-2010-45d4-adf9-704b4856e45b",
   "metadata": {},
   "outputs": [],
   "source": [
    "from perspective.widget import PerspectiveWidget\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "19c3cda1-12f7-4a0f-9647-92e687b2024d",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")\n",
    "d1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "456312b3-404d-4945-8c7b-c581a6f86857",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5361eb3d-954b-4939-ba88-fd296b743eca",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "PerspectiveWidget(d1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "54377259-d071-4ba7-9e35-3516ef6b0413",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")\n",
    "d2\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3046fbcb-edd3-46c6-a1fc-9d483bad18a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "type(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "78ddda3f-ac77-46e6-9a25-bdcf5797adf7",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ea619566-eab9-4786-a453-d482b1820b6e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "\n",
    "print(d2.columns)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cfe25852-1983-41ba-95de-40b54af25560",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "print(d2.dtypes)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0ca03956-4aa7-452b-92f4-109bbf0f4a93",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c70e30fa-4121-4726-83ea-aec080e3516a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9136c244-9a34-4e1b-b54e-e4642565bf7a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "01c4515d-964e-477b-9243-1ce7c7e4f135",
   "metadata": {},
   "outputs": [],
   "source": [
    "from perspective.widget import PerspectiveWidget\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "39307dce-8aaa-4757-9e48-7bff06601753",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 12)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>&quot;20250507&quot;</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;20190506&quot;</td><td>&quot;20190516&quot;</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190515&quot;</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190516&quot;</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;20190425&quot;</td><td>&quot;20190510&quot;</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;20190424&quot;</td><td>&quot;20190509&quot;</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 12)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬───────┬─────────┬───────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ pe    ┆ limit_a ┆ funds ┆ ballot │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ ---   ┆ mount   ┆ ---   ┆ ---    │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ f64   ┆ ---     ┆ f64   ┆ f64    │\n",
       "│         ┆ str     ┆         ┆ str     ┆   ┆       ┆ f64     ┆       ┆        │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪═══════╪═════════╪═══════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025050 ┆ … ┆ 0.0   ┆ 1.1     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 净      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.65    ┆ 0.0   ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 技      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.5     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 技      ┆ 7       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025042 ┆ … ┆ 17.57 ┆ 0.45    ┆ 5.279 ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 能      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025042 ┆ … ┆ 14.98 ┆ 255.0   ┆ 2.364 ┆ 0.0    │\n",
       "│ BJ      ┆         ┆ 份      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …     ┆ …       ┆ …     ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019050 ┆ … ┆ 22.98 ┆ 1.1     ┆ 2.425 ┆ 0.04   │\n",
       "│ SZ      ┆         ┆ 技      ┆ 6       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019043 ┆ … ┆ 16.5  ┆ 1.6     ┆ 8.367 ┆ 0.03   │\n",
       "│ SH      ┆         ┆ 子      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019043 ┆ … ┆ 22.07 ┆ 22.0    ┆ 81.55 ┆ 0.25   │\n",
       "│ SH      ┆         ┆ 源      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019042 ┆ … ┆ 22.99 ┆ 2.0     ┆ 5.466 ┆ 0.02   │\n",
       "│ SZ      ┆         ┆         ┆ 5       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019042 ┆ … ┆ 16.34 ┆ 1.7     ┆ 4.526 ┆ 0.03   │\n",
       "│ SZ      ┆         ┆ 份      ┆ 4       ┆   ┆       ┆         ┆       ┆        │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴───────┴─────────┴───────┴────────┘"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")\n",
    "d1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "6d3a21c9-fdea-4c02-8a5b-a1d308060aa2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2000, 12)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "026cd6b7-0b71-476f-b847-70fb19ab7dae",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "7a63fbeb-e96f-407a-95b5-186759de93fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5_415, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>symbol</th><th>name</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;000001.SZ&quot;</td><td>&quot;000001&quot;</td><td>&quot;平安银行&quot;</td><td>&quot;深圳&quot;</td><td>&quot;银行&quot;</td><td>&quot;平安银行股份有限公司&quot;</td><td>&quot;Ping An Bank Co., Ltd.&quot;</td><td>&quot;payh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910403&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;无实际控制人&quot;</td><td>&quot;无&quot;</td></tr><tr><td>&quot;000002.SZ&quot;</td><td>&quot;000002&quot;</td><td>&quot;万科A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;全国地产&quot;</td><td>&quot;万科企业股份有限公司&quot;</td><td>&quot;China Vanke Co.,Ltd.&quot;</td><td>&quot;wka&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910129&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000004.SZ&quot;</td><td>&quot;000004&quot;</td><td>&quot;国华网安&quot;</td><td>&quot;深圳&quot;</td><td>&quot;软件服务&quot;</td><td>&quot;深圳国华网安科技股份有限公司&quot;</td><td>&quot;Shenzhen Guohua Network Securi…</td><td>&quot;ghwa&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910114&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;李映彤&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;000006.SZ&quot;</td><td>&quot;000006&quot;</td><td>&quot;深振业A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;区域地产&quot;</td><td>&quot;深圳市振业(集团)股份有限公司&quot;</td><td>&quot;Shenzhen Zhenye(Group) Co., Lt…</td><td>&quot;szya&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920427&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000007.SZ&quot;</td><td>&quot;000007&quot;</td><td>&quot;全新好&quot;</td><td>&quot;深圳&quot;</td><td>&quot;其他商业&quot;</td><td>&quot;深圳市全新好股份有限公司&quot;</td><td>&quot;Shenzhen Quanxinhao Co,.Ltd.&quot;</td><td>&quot;qxh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920413&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;王玩虹&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;920111.BJ&quot;</td><td>&quot;920111&quot;</td><td>&quot;聚星科技&quot;</td><td>null</td><td>null</td><td>&quot;温州聚星科技股份有限公司&quot;</td><td>&quot;Wenzhou Juxing Science And Tec…</td><td>&quot;jxkj&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241111&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920116.BJ&quot;</td><td>&quot;920116&quot;</td><td>&quot;星图测控&quot;</td><td>null</td><td>null</td><td>&quot;中科星图测控技术股份有限公司&quot;</td><td>&quot;Geovis Insighter Technology Co…</td><td>&quot;xtck&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20250102&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920118.BJ&quot;</td><td>&quot;920118&quot;</td><td>&quot;太湖远大&quot;</td><td>null</td><td>null</td><td>&quot;浙江太湖远大新材料股份有限公司&quot;</td><td>&quot;Zhejiang Taihu Yuanda New Mate…</td><td>&quot;thyd&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20240822&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920128.BJ&quot;</td><td>&quot;920128&quot;</td><td>&quot;胜业电气&quot;</td><td>null</td><td>null</td><td>&quot;胜业电气股份有限公司&quot;</td><td>&quot;Shengye Electric Co., Ltd.&quot;</td><td>&quot;sydq&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241129&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;689009.SH&quot;</td><td>&quot;689009&quot;</td><td>&quot;九号公司-WD&quot;</td><td>&quot;北京&quot;</td><td>&quot;摩托车&quot;</td><td>&quot;九号有限公司&quot;</td><td>&quot;Ninebot Limited&quot;</td><td>&quot;jhgs&quot;</td><td>&quot;科创板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20201029&quot;</td><td>null</td><td>null</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5_415, 17)\n",
       "┌──────────┬────────┬─────────┬──────┬───┬─────────┬───────┬─────────┬─────────┐\n",
       "│ ts_code  ┆ symbol ┆ name    ┆ area ┆ … ┆ delist_ ┆ is_hs ┆ act_nam ┆ act_ent │\n",
       "│ ---      ┆ ---    ┆ ---     ┆ ---  ┆   ┆ date    ┆ ---   ┆ e       ┆ _type   │\n",
       "│ str      ┆ str    ┆ str     ┆ str  ┆   ┆ ---     ┆ str   ┆ ---     ┆ ---     │\n",
       "│          ┆        ┆         ┆      ┆   ┆ null    ┆       ┆ str     ┆ str     │\n",
       "╞══════════╪════════╪═════════╪══════╪═══╪═════════╪═══════╪═════════╪═════════╡\n",
       "│ 000001.S ┆ 000001 ┆ 平安银  ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 无实际  ┆ 无      │\n",
       "│ Z        ┆        ┆ 行      ┆      ┆   ┆         ┆       ┆ 控制人  ┆         │\n",
       "│ 000002.S ┆ 000002 ┆ 万科A   ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000004.S ┆ 000004 ┆ 国华网  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 李映彤  ┆ 民营企  │\n",
       "│ Z        ┆        ┆ 安      ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ 000006.S ┆ 000006 ┆ 深振业A ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000007.S ┆ 000007 ┆ 全新好  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 王玩虹  ┆ 民营企  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ …        ┆ …      ┆ …       ┆ …    ┆ … ┆ …       ┆ …     ┆ …       ┆ …       │\n",
       "│ 920111.B ┆ 920111 ┆ 聚星科  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 技      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920116.B ┆ 920116 ┆ 星图测  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 控      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920118.B ┆ 920118 ┆ 太湖远  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 大      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920128.B ┆ 920128 ┆ 胜业电  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 气      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 689009.S ┆ 689009 ┆ 九号公  ┆ 北京 ┆ … ┆ null    ┆ null  ┆ null    ┆ null    │\n",
       "│ H        ┆        ┆ 司-WD   ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "└──────────┴────────┴─────────┴──────┴───┴─────────┴───────┴─────────┴─────────┘"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")\n",
    "d2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "f196eb53-5612-4c28-822f-84f8168dc4fc",
   "metadata": {},
   "outputs": [],
   "source": [
    "config = '{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"market_ratio\":{\"number_fg_mode\":\"disabled\",\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}},\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"sub_code\":{\"format\":\"bold\",\"color\":\"#27a2aa\"},\"amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{\"market_ratio\":\"\\\"market_amount\\\"/\\\"amount\\\"\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"market_ratio\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "1956c89e-7c62-4d87-8728-70d74515d347",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"version\":\"3.6.0\",\"plugin\":\"Datagrid\",\"plugin_config\":{\"columns\":{},\"edit_mode\":\"READ_ONLY\",\"scroll_lock\":false},\"columns_config\":{\"market_ratio\":{\"number_fg_mode\":\"disabled\",\"number_bg_mode\":\"gradient\",\"bg_gradient\":1.0,\"number_format\":{\"style\":\"percent\",\"minimumFractionDigits\":2.0,\"maximumFractionDigits\":2.0}},\"market_amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}},\"sub_code\":{\"format\":\"bold\",\"color\":\"#27a2aa\"},\"amount\":{\"number_format\":{\"minimumFractionDigits\":0.0,\"maximumFractionDigits\":2.0}}},\"settings\":true,\"theme\":\"Pro Light\",\"title\":null,\"group_by\":[],\"split_by\":[],\"sort\":[],\"filter\":[],\"expressions\":{\"market_ratio\":\"\"market_amount\"/\"amount\"\"},\"columns\":[\"ts_code\",\"sub_code\",\"name\",\"ipo_date\",\"issue_date\",\"amount\",\"market_amount\",\"market_ratio\",\"price\",\"pe\",\"limit_amount\",\"funds\",\"ballot\"],\"aggregates\":{}}\n"
     ]
    }
   ],
   "source": [
    "print(config)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b9f2d271-f160-4b71-84a0-68ba220290d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "4afa2d10-b44e-48f0-a305-6414cfcfe9df",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "没有读取该文件的权限。\n"
     ]
    }
   ],
   "source": [
    "file_path = Path(r\"C:\\Users\\ASUS\\AppData\\Local\\Temp\\MicrosoftEdgeDownloads\\f826e699-92e5-4c70-893a-7d5cd5030532\")\n",
    "if file_path.exists():\n",
    "    try:\n",
    "        content = file_path.read_text(encoding=\"utf8\")\n",
    "        print(content)\n",
    "    except PermissionError:\n",
    "        print(\"没有读取该文件的权限。\")\n",
    "else:\n",
    "    print(\"文件不存在。\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "603f05e1-7ba1-42c3-985f-7d6104a550c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f5365ff2eef443eca9724311efd8611c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "72b5abab-7d38-4e3e-a93a-a89bf20b80f7",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "dad5ffdc-6d84-44bd-b982-0898d1766a61",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5415, 17)"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2.shape\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "e4e515ca-27a9-488b-9d92-e9d3ba6fc301",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>2025-05-08</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>2025-04-28</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>2019-05-06</td><td>2019-05-16</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;江苏&quot;</td><td>&quot;化纤&quot;</td><td>&quot;中简科技股份有限公司&quot;</td><td>&quot;Sinofibers Technology Co.,Ltd.&quot;</td><td>&quot;zjkj&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>2019-04-30</td><td>2019-05-15</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td><td>&quot;603267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;北京&quot;</td><td>&quot;元器件&quot;</td><td>&quot;北京元六鸿远电子科技股份有限公司&quot;</td><td>&quot;Beijing Yuanliu Hongyuan Elect…</td><td>&quot;hydz&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-15</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬────────┬───────┬────────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ delist ┆ is_hs ┆ act_na ┆ act_en │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ _date  ┆ ---   ┆ me     ┆ t_type │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ ---    ┆ str   ┆ ---    ┆ ---    │\n",
       "│         ┆ str     ┆         ┆ date    ┆   ┆ null   ┆       ┆ str    ┆ str    │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪════════╪═══════╪════════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 净      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 技      ┆ -07     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 能      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ BJ      ┆         ┆ 份      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …      ┆ …     ┆ …      ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019-05 ┆ … ┆ null   ┆ S     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -06     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 子      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 源      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆         ┆ -25     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ 冯就景 ┆ 民营企 │\n",
       "│ SZ      ┆         ┆ 份      ┆ -24     ┆   ┆        ┆       ┆        ┆ 业     │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴────────┴───────┴────────┴────────┘"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2, on=\"ts_code\", how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "90201238-b369-48f0-9a42-d50aecffd3b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a7af064d-bf58-41da-a81e-e9ae10efc090",
   "metadata": {},
   "outputs": [],
   "source": [
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5cf283f5-9c03-4886-9ae9-9abf63feb613",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 12)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>&quot;20250507&quot;</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;20190506&quot;</td><td>&quot;20190516&quot;</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190515&quot;</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190516&quot;</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;20190425&quot;</td><td>&quot;20190510&quot;</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;20190424&quot;</td><td>&quot;20190509&quot;</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 12)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬───────┬─────────┬───────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ pe    ┆ limit_a ┆ funds ┆ ballot │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ ---   ┆ mount   ┆ ---   ┆ ---    │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ f64   ┆ ---     ┆ f64   ┆ f64    │\n",
       "│         ┆ str     ┆         ┆ str     ┆   ┆       ┆ f64     ┆       ┆        │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪═══════╪═════════╪═══════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025050 ┆ … ┆ 0.0   ┆ 1.1     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 净      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.65    ┆ 0.0   ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 技      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.5     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 技      ┆ 7       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025042 ┆ … ┆ 17.57 ┆ 0.45    ┆ 5.279 ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 能      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025042 ┆ … ┆ 14.98 ┆ 255.0   ┆ 2.364 ┆ 0.0    │\n",
       "│ BJ      ┆         ┆ 份      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …     ┆ …       ┆ …     ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019050 ┆ … ┆ 22.98 ┆ 1.1     ┆ 2.425 ┆ 0.04   │\n",
       "│ SZ      ┆         ┆ 技      ┆ 6       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019043 ┆ … ┆ 16.5  ┆ 1.6     ┆ 8.367 ┆ 0.03   │\n",
       "│ SH      ┆         ┆ 子      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019043 ┆ … ┆ 22.07 ┆ 22.0    ┆ 81.55 ┆ 0.25   │\n",
       "│ SH      ┆         ┆ 源      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019042 ┆ … ┆ 22.99 ┆ 2.0     ┆ 5.466 ┆ 0.02   │\n",
       "│ SZ      ┆         ┆         ┆ 5       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019042 ┆ … ┆ 16.34 ┆ 1.7     ┆ 4.526 ┆ 0.03   │\n",
       "│ SZ      ┆         ┆ 份      ┆ 4       ┆   ┆       ┆         ┆       ┆        │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴───────┴─────────┴───────┴────────┘"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")\n",
    "d1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "3a3bb4eb-cb6d-4cdf-b330-6af8f1beb828",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "1d259e7e-a1bc-445e-b224-51efa2f3439c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5_415, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>symbol</th><th>name</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;000001.SZ&quot;</td><td>&quot;000001&quot;</td><td>&quot;平安银行&quot;</td><td>&quot;深圳&quot;</td><td>&quot;银行&quot;</td><td>&quot;平安银行股份有限公司&quot;</td><td>&quot;Ping An Bank Co., Ltd.&quot;</td><td>&quot;payh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910403&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;无实际控制人&quot;</td><td>&quot;无&quot;</td></tr><tr><td>&quot;000002.SZ&quot;</td><td>&quot;000002&quot;</td><td>&quot;万科A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;全国地产&quot;</td><td>&quot;万科企业股份有限公司&quot;</td><td>&quot;China Vanke Co.,Ltd.&quot;</td><td>&quot;wka&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910129&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000004.SZ&quot;</td><td>&quot;000004&quot;</td><td>&quot;国华网安&quot;</td><td>&quot;深圳&quot;</td><td>&quot;软件服务&quot;</td><td>&quot;深圳国华网安科技股份有限公司&quot;</td><td>&quot;Shenzhen Guohua Network Securi…</td><td>&quot;ghwa&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910114&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;李映彤&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;000006.SZ&quot;</td><td>&quot;000006&quot;</td><td>&quot;深振业A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;区域地产&quot;</td><td>&quot;深圳市振业(集团)股份有限公司&quot;</td><td>&quot;Shenzhen Zhenye(Group) Co., Lt…</td><td>&quot;szya&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920427&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000007.SZ&quot;</td><td>&quot;000007&quot;</td><td>&quot;全新好&quot;</td><td>&quot;深圳&quot;</td><td>&quot;其他商业&quot;</td><td>&quot;深圳市全新好股份有限公司&quot;</td><td>&quot;Shenzhen Quanxinhao Co,.Ltd.&quot;</td><td>&quot;qxh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920413&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;王玩虹&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;920111.BJ&quot;</td><td>&quot;920111&quot;</td><td>&quot;聚星科技&quot;</td><td>null</td><td>null</td><td>&quot;温州聚星科技股份有限公司&quot;</td><td>&quot;Wenzhou Juxing Science And Tec…</td><td>&quot;jxkj&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241111&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920116.BJ&quot;</td><td>&quot;920116&quot;</td><td>&quot;星图测控&quot;</td><td>null</td><td>null</td><td>&quot;中科星图测控技术股份有限公司&quot;</td><td>&quot;Geovis Insighter Technology Co…</td><td>&quot;xtck&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20250102&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920118.BJ&quot;</td><td>&quot;920118&quot;</td><td>&quot;太湖远大&quot;</td><td>null</td><td>null</td><td>&quot;浙江太湖远大新材料股份有限公司&quot;</td><td>&quot;Zhejiang Taihu Yuanda New Mate…</td><td>&quot;thyd&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20240822&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920128.BJ&quot;</td><td>&quot;920128&quot;</td><td>&quot;胜业电气&quot;</td><td>null</td><td>null</td><td>&quot;胜业电气股份有限公司&quot;</td><td>&quot;Shengye Electric Co., Ltd.&quot;</td><td>&quot;sydq&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241129&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;689009.SH&quot;</td><td>&quot;689009&quot;</td><td>&quot;九号公司-WD&quot;</td><td>&quot;北京&quot;</td><td>&quot;摩托车&quot;</td><td>&quot;九号有限公司&quot;</td><td>&quot;Ninebot Limited&quot;</td><td>&quot;jhgs&quot;</td><td>&quot;科创板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20201029&quot;</td><td>null</td><td>null</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5_415, 17)\n",
       "┌──────────┬────────┬─────────┬──────┬───┬─────────┬───────┬─────────┬─────────┐\n",
       "│ ts_code  ┆ symbol ┆ name    ┆ area ┆ … ┆ delist_ ┆ is_hs ┆ act_nam ┆ act_ent │\n",
       "│ ---      ┆ ---    ┆ ---     ┆ ---  ┆   ┆ date    ┆ ---   ┆ e       ┆ _type   │\n",
       "│ str      ┆ str    ┆ str     ┆ str  ┆   ┆ ---     ┆ str   ┆ ---     ┆ ---     │\n",
       "│          ┆        ┆         ┆      ┆   ┆ null    ┆       ┆ str     ┆ str     │\n",
       "╞══════════╪════════╪═════════╪══════╪═══╪═════════╪═══════╪═════════╪═════════╡\n",
       "│ 000001.S ┆ 000001 ┆ 平安银  ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 无实际  ┆ 无      │\n",
       "│ Z        ┆        ┆ 行      ┆      ┆   ┆         ┆       ┆ 控制人  ┆         │\n",
       "│ 000002.S ┆ 000002 ┆ 万科A   ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000004.S ┆ 000004 ┆ 国华网  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 李映彤  ┆ 民营企  │\n",
       "│ Z        ┆        ┆ 安      ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ 000006.S ┆ 000006 ┆ 深振业A ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000007.S ┆ 000007 ┆ 全新好  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 王玩虹  ┆ 民营企  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ …        ┆ …      ┆ …       ┆ …    ┆ … ┆ …       ┆ …     ┆ …       ┆ …       │\n",
       "│ 920111.B ┆ 920111 ┆ 聚星科  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 技      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920116.B ┆ 920116 ┆ 星图测  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 控      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920118.B ┆ 920118 ┆ 太湖远  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 大      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920128.B ┆ 920128 ┆ 胜业电  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 气      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 689009.S ┆ 689009 ┆ 九号公  ┆ 北京 ┆ … ┆ null    ┆ null  ┆ null    ┆ null    │\n",
       "│ H        ┆        ┆ 司-WD   ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "└──────────┴────────┴─────────┴──────┴───┴─────────┴───────┴─────────┴─────────┘"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")\n",
    "d2\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "793f1da6-380c-4a67-837b-10bd7ca826ec",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ce5e2ff0c190499db577c374d7265d7d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "66ae3ea0-2705-4c94-89dd-26c5a1fbc063",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "225ba68b-6742-48b7-a8c7-ac9f10b854d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ff36f3b261604c52a4911d04a2e3da31",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "0081c861-8cbd-4425-8a5e-b0a811fc3806",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>2025-05-08</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>2025-04-28</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>2019-05-06</td><td>2019-05-16</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;江苏&quot;</td><td>&quot;化纤&quot;</td><td>&quot;中简科技股份有限公司&quot;</td><td>&quot;Sinofibers Technology Co.,Ltd.&quot;</td><td>&quot;zjkj&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>2019-04-30</td><td>2019-05-15</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td><td>&quot;603267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;北京&quot;</td><td>&quot;元器件&quot;</td><td>&quot;北京元六鸿远电子科技股份有限公司&quot;</td><td>&quot;Beijing Yuanliu Hongyuan Elect…</td><td>&quot;hydz&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-15</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬────────┬───────┬────────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ delist ┆ is_hs ┆ act_na ┆ act_en │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ _date  ┆ ---   ┆ me     ┆ t_type │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ ---    ┆ str   ┆ ---    ┆ ---    │\n",
       "│         ┆ str     ┆         ┆ date    ┆   ┆ null   ┆       ┆ str    ┆ str    │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪════════╪═══════╪════════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 净      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 技      ┆ -07     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 能      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ BJ      ┆         ┆ 份      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …      ┆ …     ┆ …      ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019-05 ┆ … ┆ null   ┆ S     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -06     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 子      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 源      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆         ┆ -25     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ 冯就景 ┆ 民营企 │\n",
       "│ SZ      ┆         ┆ 份      ┆ -24     ┆   ┆        ┆       ┆        ┆ 业     │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴────────┴───────┴────────┴────────┘"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2, on=\"ts_code\", how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "59256c1a-4987-4d7d-83ee-d5ed8baaaad7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "52dd6c6d0f98424a8178b0b450ab8fae",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "7c4052f8-a8de-4e52-8ae4-ea59c3b819a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "9619da819fde40619fb6f5e61ee16247",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ad9a5f0c-1e20-44b4-b93f-163584935ae6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fcea6f4a-803f-4317-828a-06989ecd173d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from perspective.widget import PerspectiveWidget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e210ea10-e5cf-45d6-9f41-39658b958f7b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 12)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>&quot;20250508&quot;</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>&quot;20250507&quot;</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>&quot;20250428&quot;</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;20190506&quot;</td><td>&quot;20190516&quot;</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190515&quot;</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;20190430&quot;</td><td>&quot;20190516&quot;</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;20190425&quot;</td><td>&quot;20190510&quot;</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;20190424&quot;</td><td>&quot;20190509&quot;</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 12)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬───────┬─────────┬───────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ pe    ┆ limit_a ┆ funds ┆ ballot │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ ---   ┆ mount   ┆ ---   ┆ ---    │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ f64   ┆ ---     ┆ f64   ┆ f64    │\n",
       "│         ┆ str     ┆         ┆ str     ┆   ┆       ┆ f64     ┆       ┆        │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪═══════╪═════════╪═══════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025050 ┆ … ┆ 0.0   ┆ 1.1     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 净      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.65    ┆ 0.0   ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 技      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025050 ┆ … ┆ 0.0   ┆ 0.5     ┆ 0.0   ┆ 0.0    │\n",
       "│ SH      ┆         ┆ 技      ┆ 7       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025042 ┆ … ┆ 17.57 ┆ 0.45    ┆ 5.279 ┆ 0.0    │\n",
       "│ SZ      ┆         ┆ 能      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025042 ┆ … ┆ 14.98 ┆ 255.0   ┆ 2.364 ┆ 0.0    │\n",
       "│ BJ      ┆         ┆ 份      ┆ 8       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …     ┆ …       ┆ …     ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019050 ┆ … ┆ 22.98 ┆ 1.1     ┆ 2.425 ┆ 0.04   │\n",
       "│ SZ      ┆         ┆ 技      ┆ 6       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019043 ┆ … ┆ 16.5  ┆ 1.6     ┆ 8.367 ┆ 0.03   │\n",
       "│ SH      ┆         ┆ 子      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019043 ┆ … ┆ 22.07 ┆ 22.0    ┆ 81.55 ┆ 0.25   │\n",
       "│ SH      ┆         ┆ 源      ┆ 0       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019042 ┆ … ┆ 22.99 ┆ 2.0     ┆ 5.466 ┆ 0.02   │\n",
       "│ SZ      ┆         ┆         ┆ 5       ┆   ┆       ┆         ┆       ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019042 ┆ … ┆ 16.34 ┆ 1.7     ┆ 4.526 ┆ 0.03   │\n",
       "│ SZ      ┆         ┆ 份      ┆ 4       ┆   ┆       ┆         ┆       ┆        │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴───────┴─────────┴───────┴────────┘"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d1 = pl.read_parquet(\"new_share.parquet\")\n",
    "d1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "e2c28f84-2e90-494a-b0f4-84098890ff95",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    ipo_date=pl.col.ipo_date.str.to_date(\"%Y%m%d\"),\n",
    "    issue_date=pl.col.issue_date.str.to_date(\"%Y%m%d\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6db3934d-b6f4-4d38-8abe-e2655db037d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5_415, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>symbol</th><th>name</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;000001.SZ&quot;</td><td>&quot;000001&quot;</td><td>&quot;平安银行&quot;</td><td>&quot;深圳&quot;</td><td>&quot;银行&quot;</td><td>&quot;平安银行股份有限公司&quot;</td><td>&quot;Ping An Bank Co., Ltd.&quot;</td><td>&quot;payh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910403&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;无实际控制人&quot;</td><td>&quot;无&quot;</td></tr><tr><td>&quot;000002.SZ&quot;</td><td>&quot;000002&quot;</td><td>&quot;万科A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;全国地产&quot;</td><td>&quot;万科企业股份有限公司&quot;</td><td>&quot;China Vanke Co.,Ltd.&quot;</td><td>&quot;wka&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910129&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000004.SZ&quot;</td><td>&quot;000004&quot;</td><td>&quot;国华网安&quot;</td><td>&quot;深圳&quot;</td><td>&quot;软件服务&quot;</td><td>&quot;深圳国华网安科技股份有限公司&quot;</td><td>&quot;Shenzhen Guohua Network Securi…</td><td>&quot;ghwa&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19910114&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;李映彤&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&quot;000006.SZ&quot;</td><td>&quot;000006&quot;</td><td>&quot;深振业A&quot;</td><td>&quot;深圳&quot;</td><td>&quot;区域地产&quot;</td><td>&quot;深圳市振业(集团)股份有限公司&quot;</td><td>&quot;Shenzhen Zhenye(Group) Co., Lt…</td><td>&quot;szya&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920427&quot;</td><td>null</td><td>&quot;S&quot;</td><td>&quot;深圳市人民政府国有资产监督管理委员会&quot;</td><td>&quot;地方国企&quot;</td></tr><tr><td>&quot;000007.SZ&quot;</td><td>&quot;000007&quot;</td><td>&quot;全新好&quot;</td><td>&quot;深圳&quot;</td><td>&quot;其他商业&quot;</td><td>&quot;深圳市全新好股份有限公司&quot;</td><td>&quot;Shenzhen Quanxinhao Co,.Ltd.&quot;</td><td>&quot;qxh&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;19920413&quot;</td><td>null</td><td>&quot;N&quot;</td><td>&quot;王玩虹&quot;</td><td>&quot;民营企业&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;920111.BJ&quot;</td><td>&quot;920111&quot;</td><td>&quot;聚星科技&quot;</td><td>null</td><td>null</td><td>&quot;温州聚星科技股份有限公司&quot;</td><td>&quot;Wenzhou Juxing Science And Tec…</td><td>&quot;jxkj&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241111&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920116.BJ&quot;</td><td>&quot;920116&quot;</td><td>&quot;星图测控&quot;</td><td>null</td><td>null</td><td>&quot;中科星图测控技术股份有限公司&quot;</td><td>&quot;Geovis Insighter Technology Co…</td><td>&quot;xtck&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20250102&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920118.BJ&quot;</td><td>&quot;920118&quot;</td><td>&quot;太湖远大&quot;</td><td>null</td><td>null</td><td>&quot;浙江太湖远大新材料股份有限公司&quot;</td><td>&quot;Zhejiang Taihu Yuanda New Mate…</td><td>&quot;thyd&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20240822&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;920128.BJ&quot;</td><td>&quot;920128&quot;</td><td>&quot;胜业电气&quot;</td><td>null</td><td>null</td><td>&quot;胜业电气股份有限公司&quot;</td><td>&quot;Shengye Electric Co., Ltd.&quot;</td><td>&quot;sydq&quot;</td><td>&quot;北交所&quot;</td><td>&quot;BSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20241129&quot;</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;689009.SH&quot;</td><td>&quot;689009&quot;</td><td>&quot;九号公司-WD&quot;</td><td>&quot;北京&quot;</td><td>&quot;摩托车&quot;</td><td>&quot;九号有限公司&quot;</td><td>&quot;Ninebot Limited&quot;</td><td>&quot;jhgs&quot;</td><td>&quot;科创板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>&quot;20201029&quot;</td><td>null</td><td>null</td><td>null</td><td>null</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5_415, 17)\n",
       "┌──────────┬────────┬─────────┬──────┬───┬─────────┬───────┬─────────┬─────────┐\n",
       "│ ts_code  ┆ symbol ┆ name    ┆ area ┆ … ┆ delist_ ┆ is_hs ┆ act_nam ┆ act_ent │\n",
       "│ ---      ┆ ---    ┆ ---     ┆ ---  ┆   ┆ date    ┆ ---   ┆ e       ┆ _type   │\n",
       "│ str      ┆ str    ┆ str     ┆ str  ┆   ┆ ---     ┆ str   ┆ ---     ┆ ---     │\n",
       "│          ┆        ┆         ┆      ┆   ┆ null    ┆       ┆ str     ┆ str     │\n",
       "╞══════════╪════════╪═════════╪══════╪═══╪═════════╪═══════╪═════════╪═════════╡\n",
       "│ 000001.S ┆ 000001 ┆ 平安银  ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 无实际  ┆ 无      │\n",
       "│ Z        ┆        ┆ 行      ┆      ┆   ┆         ┆       ┆ 控制人  ┆         │\n",
       "│ 000002.S ┆ 000002 ┆ 万科A   ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000004.S ┆ 000004 ┆ 国华网  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 李映彤  ┆ 民营企  │\n",
       "│ Z        ┆        ┆ 安      ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ 000006.S ┆ 000006 ┆ 深振业A ┆ 深圳 ┆ … ┆ null    ┆ S     ┆ 深圳市  ┆ 地方国  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆ 人民政  ┆ 企      │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 府国有  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 资产监  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 督管理  ┆         │\n",
       "│          ┆        ┆         ┆      ┆   ┆         ┆       ┆ 委员会  ┆         │\n",
       "│ 000007.S ┆ 000007 ┆ 全新好  ┆ 深圳 ┆ … ┆ null    ┆ N     ┆ 王玩虹  ┆ 民营企  │\n",
       "│ Z        ┆        ┆         ┆      ┆   ┆         ┆       ┆         ┆ 业      │\n",
       "│ …        ┆ …      ┆ …       ┆ …    ┆ … ┆ …       ┆ …     ┆ …       ┆ …       │\n",
       "│ 920111.B ┆ 920111 ┆ 聚星科  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 技      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920116.B ┆ 920116 ┆ 星图测  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 控      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920118.B ┆ 920118 ┆ 太湖远  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 大      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 920128.B ┆ 920128 ┆ 胜业电  ┆ null ┆ … ┆ null    ┆ N     ┆ null    ┆ null    │\n",
       "│ J        ┆        ┆ 气      ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "│ 689009.S ┆ 689009 ┆ 九号公  ┆ 北京 ┆ … ┆ null    ┆ null  ┆ null    ┆ null    │\n",
       "│ H        ┆        ┆ 司-WD   ┆      ┆   ┆         ┆       ┆         ┆         │\n",
       "└──────────┴────────┴─────────┴──────┴───┴─────────┴───────┴─────────┴─────────┘"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2 = pl.read_parquet(\"stock_basic.parquet\")\n",
    "d2\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "069cdd84-883e-4dd5-a27f-ac223b641583",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "c28ce8e015e6490e85ae82f2d207e1fd",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "4666cdc2-1c73-4713-8045-134d04dfb147",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.with_columns(\n",
    "    list_date=pl.col.list_date.str.to_date(\"%Y%m%d\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "b054bbe0-0788-482a-95c4-3b48d6611f96",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "8dae0dd305814101b70f96f68a82c80f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'symbol', 'name', 'area', 'industry', 'fullname',…"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(d2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "3cd1c871-5d53-40a5-ae77-eb623b2f499b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2_000, 28)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>ts_code</th><th>sub_code</th><th>name</th><th>ipo_date</th><th>issue_date</th><th>amount</th><th>market_amount</th><th>price</th><th>pe</th><th>limit_amount</th><th>funds</th><th>ballot</th><th>symbol</th><th>name_right</th><th>area</th><th>industry</th><th>fullname</th><th>enname</th><th>cnspell</th><th>market</th><th>exchange</th><th>curr_type</th><th>list_status</th><th>list_date</th><th>delist_date</th><th>is_hs</th><th>act_name</th><th>act_ent_type</th></tr><tr><td>str</td><td>str</td><td>str</td><td>date</td><td>date</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>date</td><td>null</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;603014.SH&quot;</td><td>&quot;732014&quot;</td><td>&quot;威高血净&quot;</td><td>2025-05-08</td><td>null</td><td>4114.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1.1</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301595.SZ&quot;</td><td>&quot;301595&quot;</td><td>&quot;太力科技&quot;</td><td>2025-05-08</td><td>null</td><td>2707.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.65</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;688755.SH&quot;</td><td>&quot;787755&quot;</td><td>&quot;汉邦科技&quot;</td><td>2025-05-07</td><td>null</td><td>2200.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.0</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;301636.SZ&quot;</td><td>&quot;301636&quot;</td><td>&quot;泽润新能&quot;</td><td>2025-04-28</td><td>null</td><td>1597.0</td><td>455.0</td><td>33.06</td><td>17.57</td><td>0.45</td><td>5.279</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;920068.BJ&quot;</td><td>&quot;920068&quot;</td><td>&quot;天工股份&quot;</td><td>2025-04-28</td><td>null</td><td>6000.0</td><td>4200.0</td><td>3.94</td><td>14.98</td><td>255.0</td><td>2.364</td><td>0.0</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;300777.SZ&quot;</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>2019-05-06</td><td>2019-05-16</td><td>4001.0</td><td>3601.0</td><td>6.06</td><td>22.98</td><td>1.1</td><td>2.425</td><td>0.04</td><td>&quot;300777&quot;</td><td>&quot;中简科技&quot;</td><td>&quot;江苏&quot;</td><td>&quot;化纤&quot;</td><td>&quot;中简科技股份有限公司&quot;</td><td>&quot;Sinofibers Technology Co.,Ltd.&quot;</td><td>&quot;zjkj&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;S&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;603267.SH&quot;</td><td>&quot;732267&quot;</td><td>&quot;鸿远电子&quot;</td><td>2019-04-30</td><td>2019-05-15</td><td>4134.0</td><td>3721.0</td><td>20.24</td><td>16.5</td><td>1.6</td><td>8.367</td><td>0.03</td><td>&quot;603267&quot;</td><td>&quot;鸿远电子&quot;</td><td>&quot;北京&quot;</td><td>&quot;元器件&quot;</td><td>&quot;北京元六鸿远电子科技股份有限公司&quot;</td><td>&quot;Beijing Yuanliu Hongyuan Elect…</td><td>&quot;hydz&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-15</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;600989.SH&quot;</td><td>&quot;730989&quot;</td><td>&quot;宝丰能源&quot;</td><td>2019-04-30</td><td>2019-05-16</td><td>73336.0</td><td>66002.0</td><td>11.12</td><td>22.07</td><td>22.0</td><td>81.55</td><td>0.25</td><td>&quot;600989&quot;</td><td>&quot;宝丰能源&quot;</td><td>&quot;宁夏&quot;</td><td>&quot;化工原料&quot;</td><td>&quot;宁夏宝丰能源集团股份有限公司&quot;</td><td>&quot;Ningxia Baofeng Energy Group C…</td><td>&quot;bfny&quot;</td><td>&quot;主板&quot;</td><td>&quot;SSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-16</td><td>null</td><td>&quot;H&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;300778.SZ&quot;</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>2019-04-25</td><td>2019-05-10</td><td>2000.0</td><td>2000.0</td><td>27.33</td><td>22.99</td><td>2.0</td><td>5.466</td><td>0.02</td><td>&quot;300778&quot;</td><td>&quot;新城市&quot;</td><td>&quot;深圳&quot;</td><td>&quot;建筑工程&quot;</td><td>&quot;深圳市新城市规划建筑设计股份有限公司&quot;</td><td>&quot;Shenzhen New Land Tool Plannin…</td><td>&quot;xcs&quot;</td><td>&quot;创业板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-10</td><td>null</td><td>&quot;N&quot;</td><td>null</td><td>null</td></tr><tr><td>&quot;002953.SZ&quot;</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>2019-04-24</td><td>2019-05-09</td><td>4302.0</td><td>3872.0</td><td>10.52</td><td>16.34</td><td>1.7</td><td>4.526</td><td>0.03</td><td>&quot;002953&quot;</td><td>&quot;日丰股份&quot;</td><td>&quot;广东&quot;</td><td>&quot;电气设备&quot;</td><td>&quot;广东日丰电缆股份有限公司&quot;</td><td>&quot;Guangdong Rifeng Electric Cabl…</td><td>&quot;rfgf&quot;</td><td>&quot;主板&quot;</td><td>&quot;SZSE&quot;</td><td>&quot;CNY&quot;</td><td>&quot;L&quot;</td><td>2019-05-09</td><td>null</td><td>&quot;N&quot;</td><td>&quot;冯就景&quot;</td><td>&quot;民营企业&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2_000, 28)\n",
       "┌─────────┬─────────┬─────────┬─────────┬───┬────────┬───────┬────────┬────────┐\n",
       "│ ts_code ┆ sub_cod ┆ name    ┆ ipo_dat ┆ … ┆ delist ┆ is_hs ┆ act_na ┆ act_en │\n",
       "│ ---     ┆ e       ┆ ---     ┆ e       ┆   ┆ _date  ┆ ---   ┆ me     ┆ t_type │\n",
       "│ str     ┆ ---     ┆ str     ┆ ---     ┆   ┆ ---    ┆ str   ┆ ---    ┆ ---    │\n",
       "│         ┆ str     ┆         ┆ date    ┆   ┆ null   ┆       ┆ str    ┆ str    │\n",
       "╞═════════╪═════════╪═════════╪═════════╪═══╪════════╪═══════╪════════╪════════╡\n",
       "│ 603014. ┆ 732014  ┆ 威高血  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 净      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301595. ┆ 301595  ┆ 太力科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -08     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 688755. ┆ 787755  ┆ 汉邦科  ┆ 2025-05 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 技      ┆ -07     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 301636. ┆ 301636  ┆ 泽润新  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 能      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 920068. ┆ 920068  ┆ 天工股  ┆ 2025-04 ┆ … ┆ null   ┆ null  ┆ null   ┆ null   │\n",
       "│ BJ      ┆         ┆ 份      ┆ -28     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …       ┆ … ┆ …      ┆ …     ┆ …      ┆ …      │\n",
       "│ 300777. ┆ 300777  ┆ 中简科  ┆ 2019-05 ┆ … ┆ null   ┆ S     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆ 技      ┆ -06     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 603267. ┆ 732267  ┆ 鸿远电  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 子      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 600989. ┆ 730989  ┆ 宝丰能  ┆ 2019-04 ┆ … ┆ null   ┆ H     ┆ null   ┆ null   │\n",
       "│ SH      ┆         ┆ 源      ┆ -30     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 300778. ┆ 300778  ┆ 新城市  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ null   ┆ null   │\n",
       "│ SZ      ┆         ┆         ┆ -25     ┆   ┆        ┆       ┆        ┆        │\n",
       "│ 002953. ┆ 002953  ┆ 日丰股  ┆ 2019-04 ┆ … ┆ null   ┆ N     ┆ 冯就景 ┆ 民营企 │\n",
       "│ SZ      ┆         ┆ 份      ┆ -24     ┆   ┆        ┆       ┆        ┆ 业     │\n",
       "└─────────┴─────────┴─────────┴─────────┴───┴────────┴───────┴────────┴────────┘"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = d1.join(d2, on=\"ts_code\", how=\"left\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ca351bb4-0677-488a-bcca-03d5d15058fd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5d7cd8a868a2420fab15a0fb43794a18",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "e4ef6673-037b-417c-af54-8beeca989da5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b700eb1df4db470588b2c976f974b20c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "6adbd861-30f9-484f-bc1c-5444416801e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "444ea334bac24ebabf98ae05c5f3dddb",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "PerspectiveWidget(binding_mode='server', columns=['ts_code', 'sub_code', 'name', 'ipo_date', 'issue_date', 'am…"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "PerspectiveWidget(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bf8e3538-1c83-4266-b8cb-ada674c9be7f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
